3.1.54 \(\int \frac {c+d x}{a+b \coth (e+f x)} \, dx\) [54]

Optimal. Leaf size=108 \[ \frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d \text {PolyLog}\left (2,\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^2} \]

[Out]

1/2*(d*x+c)^2/(a+b)/d-b*(d*x+c)*ln(1+(-a+b)/(a+b)/exp(2*f*x+2*e))/(a^2-b^2)/f+1/2*b*d*polylog(2,(a-b)/(a+b)/ex
p(2*f*x+2*e))/(a^2-b^2)/f^2

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3812, 2221, 2317, 2438} \begin {gather*} -\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{f \left (a^2-b^2\right )}+\frac {b d \text {Li}_2\left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f^2 \left (a^2-b^2\right )}+\frac {(c+d x)^2}{2 d (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)/(a + b*Coth[e + f*x]),x]

[Out]

(c + d*x)^2/(2*(a + b)*d) - (b*(c + d*x)*Log[1 - (a - b)/((a + b)*E^(2*(e + f*x)))])/((a^2 - b^2)*f) + (b*d*Po
lyLog[2, (a - b)/((a + b)*E^(2*(e + f*x)))])/(2*(a^2 - b^2)*f^2)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3812

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + d*x)^
(m + 1)/(d*(m + 1)*(a + I*b)), x] + Dist[2*I*b, Int[(c + d*x)^m*E^(2*I*k*Pi)*(E^Simp[2*I*(e + f*x), x]/((a + I
*b)^2 + (a^2 + b^2)*E^(2*I*k*Pi)*E^Simp[2*I*(e + f*x), x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && Integer
Q[4*k] && NeQ[a^2 + b^2, 0] && IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {c+d x}{a+b \coth (e+f x)} \, dx &=\frac {(c+d x)^2}{2 (a+b) d}-(2 b) \int \frac {e^{-2 (e+f x)} (c+d x)}{(a+b)^2+\left (-a^2+b^2\right ) e^{-2 (e+f x)}} \, dx\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {(b d) \int \log \left (1+\frac {\left (-a^2+b^2\right ) e^{-2 (e+f x)}}{(a+b)^2}\right ) \, dx}{\left (a^2-b^2\right ) f}\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}-\frac {(b d) \text {Subst}\left (\int \frac {\log \left (1+\frac {\left (-a^2+b^2\right ) x}{(a+b)^2}\right )}{x} \, dx,x,e^{-2 (e+f x)}\right )}{2 \left (a^2-b^2\right ) f^2}\\ &=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d \text {Li}_2\left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.73, size = 93, normalized size = 0.86 \begin {gather*} \frac {f \left ((a+b) f x (2 c+d x)-2 b (c+d x) \log \left (1+\frac {(a+b) e^{2 (e+f x)}}{-a+b}\right )\right )-b d \text {PolyLog}\left (2,\frac {(a+b) e^{2 (e+f x)}}{a-b}\right )}{2 (a-b) (a+b) f^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)/(a + b*Coth[e + f*x]),x]

[Out]

(f*((a + b)*f*x*(2*c + d*x) - 2*b*(c + d*x)*Log[1 + ((a + b)*E^(2*(e + f*x)))/(-a + b)]) - b*d*PolyLog[2, ((a
+ b)*E^(2*(e + f*x)))/(a - b)])/(2*(a - b)*(a + b)*f^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(356\) vs. \(2(107)=214\).
time = 4.82, size = 357, normalized size = 3.31

method result size
risch \(\frac {d \,x^{2}}{2 b +2 a}+\frac {c x}{a +b}+\frac {2 b c \ln \left ({\mathrm e}^{f x +e}\right )}{f \left (a +b \right ) \left (a -b \right )}-\frac {b c \ln \left (a \,{\mathrm e}^{2 f x +2 e}+b \,{\mathrm e}^{2 f x +2 e}-a +b \right )}{f \left (a +b \right ) \left (a -b \right )}-\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right ) x}{f \left (a +b \right ) \left (a -b \right )}-\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right ) e}{f^{2} \left (a +b \right ) \left (a -b \right )}+\frac {b d \,x^{2}}{\left (a +b \right ) \left (a -b \right )}+\frac {2 b d e x}{f \left (a +b \right ) \left (a -b \right )}+\frac {b d \,e^{2}}{f^{2} \left (a +b \right ) \left (a -b \right )}-\frac {b d \polylog \left (2, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right )}{2 f^{2} \left (a +b \right ) \left (a -b \right )}-\frac {2 b d e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2} \left (a +b \right ) \left (a -b \right )}+\frac {b d e \ln \left (a \,{\mathrm e}^{2 f x +2 e}+b \,{\mathrm e}^{2 f x +2 e}-a +b \right )}{f^{2} \left (a +b \right ) \left (a -b \right )}\) \(357\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a+b*coth(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/2/(a+b)*d*x^2+1/(a+b)*c*x+2/f*b/(a+b)*c/(a-b)*ln(exp(f*x+e))-1/f*b/(a+b)*c/(a-b)*ln(a*exp(2*f*x+2*e)+b*exp(2
*f*x+2*e)-a+b)-1/f*b/(a+b)*d/(a-b)*ln(1-(a+b)*exp(2*f*x+2*e)/(a-b))*x-1/f^2*b/(a+b)*d/(a-b)*ln(1-(a+b)*exp(2*f
*x+2*e)/(a-b))*e+b/(a+b)/(a-b)*d*x^2+2/f*b/(a+b)/(a-b)*d*e*x+1/f^2*b/(a+b)/(a-b)*d*e^2-1/2/f^2*b/(a+b)*d/(a-b)
*polylog(2,(a+b)*exp(2*f*x+2*e)/(a-b))-2/f^2*b/(a+b)*d*e/(a-b)*ln(exp(f*x+e))+1/f^2*b/(a+b)*d*e/(a-b)*ln(a*exp
(2*f*x+2*e)+b*exp(2*f*x+2*e)-a+b)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*coth(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(4*b*integrate(-x/(a^2 - b^2 - (a^2 + 2*a*b + b^2)*e^(2*f*x + 2*e)), x) - x^2/(a + b))*d - c*(b*log(-(a -
 b)*e^(-2*f*x - 2*e) + a + b)/((a^2 - b^2)*f) - (f*x + e)/((a + b)*f))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 362 vs. \(2 (105) = 210\).
time = 0.41, size = 362, normalized size = 3.35 \begin {gather*} \frac {{\left (a + b\right )} d f^{2} x^{2} + 2 \, {\left (a + b\right )} c f^{2} x - 2 \, b d {\rm Li}_2\left (\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )}\right ) - 2 \, b d {\rm Li}_2\left (-\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )}\right ) - 2 \, {\left (b c f - b d \cosh \left (1\right ) - b d \sinh \left (1\right )\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a - b\right )} \sqrt {\frac {a + b}{a - b}}\right ) - 2 \, {\left (b c f - b d \cosh \left (1\right ) - b d \sinh \left (1\right )\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) - 2 \, {\left (a - b\right )} \sqrt {\frac {a + b}{a - b}}\right ) - 2 \, {\left (b d f x + b d \cosh \left (1\right ) + b d \sinh \left (1\right )\right )} \log \left (\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )} + 1\right ) - 2 \, {\left (b d f x + b d \cosh \left (1\right ) + b d \sinh \left (1\right )\right )} \log \left (-\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )} + 1\right )}{2 \, {\left (a^{2} - b^{2}\right )} f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*coth(f*x+e)),x, algorithm="fricas")

[Out]

1/2*((a + b)*d*f^2*x^2 + 2*(a + b)*c*f^2*x - 2*b*d*dilog(sqrt((a + b)/(a - b))*(cosh(f*x + cosh(1) + sinh(1))
+ sinh(f*x + cosh(1) + sinh(1)))) - 2*b*d*dilog(-sqrt((a + b)/(a - b))*(cosh(f*x + cosh(1) + sinh(1)) + sinh(f
*x + cosh(1) + sinh(1)))) - 2*(b*c*f - b*d*cosh(1) - b*d*sinh(1))*log(2*(a + b)*cosh(f*x + cosh(1) + sinh(1))
+ 2*(a + b)*sinh(f*x + cosh(1) + sinh(1)) + 2*(a - b)*sqrt((a + b)/(a - b))) - 2*(b*c*f - b*d*cosh(1) - b*d*si
nh(1))*log(2*(a + b)*cosh(f*x + cosh(1) + sinh(1)) + 2*(a + b)*sinh(f*x + cosh(1) + sinh(1)) - 2*(a - b)*sqrt(
(a + b)/(a - b))) - 2*(b*d*f*x + b*d*cosh(1) + b*d*sinh(1))*log(sqrt((a + b)/(a - b))*(cosh(f*x + cosh(1) + si
nh(1)) + sinh(f*x + cosh(1) + sinh(1))) + 1) - 2*(b*d*f*x + b*d*cosh(1) + b*d*sinh(1))*log(-sqrt((a + b)/(a -
b))*(cosh(f*x + cosh(1) + sinh(1)) + sinh(f*x + cosh(1) + sinh(1))) + 1))/((a^2 - b^2)*f^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {c + d x}{a + b \coth {\left (e + f x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*coth(f*x+e)),x)

[Out]

Integral((c + d*x)/(a + b*coth(e + f*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*coth(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)/(b*coth(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {c+d\,x}{a+b\,\mathrm {coth}\left (e+f\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/(a + b*coth(e + f*x)),x)

[Out]

int((c + d*x)/(a + b*coth(e + f*x)), x)

________________________________________________________________________________________